Ektron CMS400.Net Reference

>>Managing User Communities > Micro-messaging Server Control

Micro-messaging Server Control

The Micro-messaging server control allows users to post brief messages. It resembles micro-blogging services like Twitter. An example of the Micro-messaging control within Ektron CMS400.NET’s sample Ektron Tech site is circled below.

A user can reply to another user’s micro-message, as illustrated below. See Also: Replying to a Micro-message.

The control also lets users search micro-messages. See Also: Searching for Micro-messages

In addition, Micro-messages are a type of notification.

This feature builds tighter-knit communities by allowing members to share information and feel they have a personal stake in that information.

Note: If you are in a load-balanced environment, the same reply may appear several times. If this problem occurs, stop the Ektron notification service on all but one of the servers in the cluster.

This section also contains the following topics.

Micro-Message Controls on Sample Sites

Micro-messages are an Activity Type

Micro-messaging Display Modes

Making a Hyperlink to a Single Page Version of a Micro-message

Searching for Micro-messages

Replying to a Micro-message

Filtering Micro-message Spam

Micro-messaging Server Control Properties

Note: A user’s Private Profile setting has three possible values: Public, Private and Colleague. When discussing this control and these settings, Private and Colleague both act as Colleague.

Micro-Message Controls on Sample Sites

You can find examples of the Micro-message server control in these Ektron sample sites. You can copy and edit the samples as needed to build your own pages.

Micro-messages are an Activity Type

A micro-message is type of Ektron CMS400.NET activity, like adding content or joining a Community Group. As such, a new micro-message can generate a notification. See Also: Notifications

Like other notifications, Micro-messages can appear on an Activity Stream control. Micro-messages are circled in the example below.

Also like other activities, users can determine if they want to be notified about colleagues' Micro-messages on the User Profile > Activities Tab > Colleagues subtab, and to notify others on the My Activities subtab.

Micro-messaging Display Modes

This Micro-messaging server control has four modes, which let you control the messages being displayed.

Mode

Displays this type of micro-message

For more information, see

User

From the user associated with the control

User Mode

Colleagues

From the user associated with the control and his colleagues

Colleagues Mode

TimeLine

For all site users whose Private Profile setting is set to Public

TimeLine Mode

Message

A single micro-message on a page

Message Mode

Associating the Control with a User

Like other Ektron CMS400.NET server controls, there are two ways to specify the user associated with the control.

User Mode

This mode displays micro-messages from the user associated with the control. See Also: Associating the Control with a User

Use this mode to show micro-messages for a specified user, such as on a User Profile page. For example, when Mark views his own page in User Mode, he can

Below is an example of the Micro-messaging server control with the Mode property set to User.

Using User Mode while Viewing Another User’s Profile

In User Mode, a user can view the control that is associated with another user. For example, one user views another's profile, which contains the Micro-messaging control in User Mode.

The visitor sees only micro-messages of the user who owns the profile. The visitor cannot submit a micro-message from his colleague’s profile page, nor can he search micro-messages.

For example, Bob and Steve are colleagues. When Bob views Steve’s profile page, he

Colleagues Mode

Colleagues Mode displays micro-messages from the user associated with the control and his colleagues. Use this mode to show micro-messages for these users, such as on a user profile page.

When a logged-in user visits a page containing a Micro-messaging control in colleagues mode, he can

Using Colleagues Mode while Viewing Another User’s Profile

A user can also view the control in Colleagues Mode when it is associated with another user. For example, one user views another user’s profile, which contains the Micro-messaging control in Colleagues Mode.

The first user only sees micro-messages from the user who owns the profile and colleagues he has in common with the other user. The first user cannot submit a micro-message from his colleague’s profile page, nor can he search micro-messages.

For example, Bob and Steve are colleagues. When Bob views Steve’s profile page, he

TimeLine Mode

This mode displays micro-messages for all of a site’s users whose Private Profile setting is set to Public. This mode displays a chronological stream of micro-messages from all such users, with the most recent at top.

Whenever a user whose profile is set to Public submits a micro-message, it’s added to the time line.

From the time line page, logged in users can reply to and search micro-messages. See Also: Replying to a Micro-message, Searching for Micro-messages

Message Mode

This mode displays a single micro-message on a page.

For example, John sends his boss a link to a micro-message that praises his work. When his boss clicks the link, he is taken to a page that contains this control. See Also: Making a Hyperlink to a Single Page Version of a Micro-message

Making a Hyperlink to a Single Page Version of a Micro-message

Each micro-message includes a time lapse, that is, the length of time since a message was submitted. See example below.

Each micro-message’s time lapse can become a hyperlink that contains the ID of that message and a destination window. As a result, users can click the link to view that message in the new window, as shown below.

The destination window must

Users can also copy the link and send it to another user, who can then view the message. To copy a time lapse’s link information, hover over the link, right click, and select Copy Shortcut (if using Internet Explorer) or Copy Link Location (if using Firefox).

Note: If someone sends a micro-message link to another user who is ineligible to see the message, it does not appear. To see the message, either the user who submitted it has his profile set to Public, or the link recipient must be a colleague of the message's creator.

Below is an example of how to set up this capability.

Note: For a full description of the Micro-message server control properties, see Micro-messaging Server Control Properties.

  1. On Page1.aspx, add a Micro-messaging server control.
  2. Set the DynamicObjectParameter to id.
  3. Set the TemplateMessage to the path to Page2.aspx.
  4. Set the Mode property to anything other than Message.
  5. Save Page1.aspx.
  6. On Page2.aspx, add a Micro-messaging server control.
  7. Set the DynamicObjectParameter to id.
  8. Set the Mode property to Message.
  9. Save Page2.aspx.

Now, when you log in to your site and navigate to Page1.aspx, you see a list of your micro-messages. If you click the time lapse on any message, Page2.aspx loads, showing the message you clicked.

Searching for Micro-messages

The Micro-messaging server control includes search functionality that prompts a user to enter terms and returns micro-messages that match them. The search looks through micro-messages only. It does not search content, products, users, or groups.

When searching, a user can only find micro-messages submitted by

The following topics explain how to enable and use the micro-message search.

Enabling the Micro-message Search

Entering Multiple Search Terms

Enabling the Micro-message Search

The micro-message search requires your server to have the Full Text Search component of Microsoft SQL Server.

You can install the Full Text Search component during the installation of Microsoft SQL Server.

Installing the Full Text Search Component

If the Full Text Search component is not installed, and you want to use the Micro-messaging search functionality, insert the SQL Server installation disc into your computer and look for Full Text Search.

After the Full Text Search is installed, run the FullTextIndex.sql script on your database. This script is located in:

Program Files\Ektron\CMS400v8x\Utilities\SiteSetup\Database\FullTextIndex.sql

Running a Micro-message Search

When Micro-message search is enabled, a Search tab appears on the control. To use the search, click the tab and enter search terms.

When results appear, you can click any message’s time span to proceed to the message itself. If a reply appears among search results, you can click the link indicated below to view the original message.

Entering Multiple Search Terms

You can enter more than one search term. If you do, the terms have an “and” relationship. For example, if you enter Community and Group, only messages containing both Community and Group are found.

Multiple Search Term Example

Consider the following micro-messages:

Peter: Wow, this is a great community.

Paul: I just joined the Motorcycle group

Mary: I just created a new community group for Scrapbooking called “Clippers”

If you enter Community Group in the search box, the search returns only Mary’s message, since it is the only one with both words.

Replying to a Micro-message

The Micro-message control lets users reply to micro-messages and nests the reply with the original message. Anyone who can see a message can reply to it, and see all other replies.

To add a reply, hover over a message and click Reply (). When you do, a dialog box prompts you to submit a reply of up to 2000 characters. The box also displays the original message.

Replies do not appear when a micro-message is viewed. Instead, a Replies link appears below the comment. The number of replies appears next to the link.

Click Replies to view them. The newest replies are at the top.

To remove a reply, click Delete (),which appears when you hover over the reply. Only the user who submitted the reply and the message board owner can delete replies.

Note: If you are in a load-balanced environment, the same reply may appear several times. If this problem occurs, stop the Ektron notification service on all but one of the servers in the cluster.

Filtering Micro-message Spam

You can filter spam from Micro-messages. Ektron defines spam filtering as preventing users from posting a micro-message or replying using:

Note: If a user enters a micro-message and a reply that have the same text, each can be sent once without being stopped by the spam filter. However, if either is sent a second time within the specified time period, the spam filter blocks it.

The Micro-messaging server control also lets you define custom spam filters.

To define a spam filter, use the SpamControlType property on the MessageBoard server control. The table below provides possible values and examples of how to set that property.

As a developer I want to...

So I set the SpamControlType property to...

And I set the SpamTimeSpan property to …

Prevent the same user from posting the same message more than once a day

SameUserSameMessageSameDay

 

Prevent a user from posting any additional messages for 30 minutes

SameUserTimeDelay

1800

Prevent a user from posting the same message for 2 hours

SameMessageTimeDelay

7200

Use my own spam filter code

Custom and add the code to the code behind page of the template containing the Micro-messaging server control. See Also: Creating a Custom Spam Filter

 

Creating a Custom Spam Filter

You can create your own spam filter in the code behind of the page that contains the Micro-messaging control. To do this, set the SpamControlType property to Custom, call the CustomSpamMethod in the page load event, and point it to your custom spam filter method.

The following Visual Basic example blocks the text “Hello World.”

Partial Class Default

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Me.MicroMessaging1.CustomSpamMethod(AddressOf SpamHandler)

End Sub

Private Function SpamHandler(ByVal data As Ektron.Cms.MicroMessageData) As Boolean

If data.MessageText = "Hello World" Then

Return True

End If

End Function

End Class

Micro-messaging Server Control Properties

The Micro-messaging server control properties are described in this table.

Note: The following table only lists Ektron-specific properties. It does not describe native .NET properties such as font, height, width and border style. For documentation of these properties, see Visual Studio help.

Property

Description

Data Type

Authenticated

Indicates if you are logged in to the CMS Explorer and can use it to browse to Content, Collections, etc. See Also: Working with Ektron CMS400.NET Server Controls

String

CacheInterval

Sets the amount of time the server control’s data is cached. The default is 0 (zero). This is the amount of time, in seconds, a control’s data is cached.

For example, if you want to cache the data for five minutes, set this property to 300 (three hundred). See Also: Caching with Server Controls

Double

DefaultObjectID

The default object ID for this control to use when there is no matching dynamic parameter value passed.

Long

DisplayXslt

Determines how information is displayed on the page. Enter the path to the XSL file. It can be relative or absolute.

Warning! : If you specify an external file, it is strongly recommended that you do not store this file your site’s Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.

String

 

DoInitFill

By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, FIll is automatically called during the Page Render event.

You might do this if you need to set or change a property on the control in codebehind and have it render with your changes shown.

Boolean

DynamicObjectParameter

Gets or sets the QueryString parameter to read a object ID dynamically. To use the default object ID, leave blank.

For example, if you are passing the ID value of a user, you might enter ‘uid’ for this property. So, if you passed
http://~yoursite~/UPpage.aspx?uid=21 on the QueryStrings to a page containing this control, you would see the list of Micro-messages for the user with an ID of 21.

String

EnablePaging

This property, in conjunction with the MaxResults property, lets site visitors view an unlimited number of notifications while controlling the amount of screen space. To accomplish this, the display is limited to the number set in the MaxResults property.

If you set this property to true, and the number of items exceeds the MaxResults number, navigation aids appear below the last item.

Boolean

Hide

Used to hide output of the control in design time and run time.

True = Hide control

False = Display control

Boolean

Language

Set a language for viewing the ActivityStream control. This property shows results in design-time (in Visual Studio) and at run-time (in a browser).

Integer

MaxResults

The maximum number of messages to return. 0 (zero) = unlimited.

Integer

MaxSearchResults

The maximum number of messages to return when performing a micro-message search.
0 (zero) = unlimited.

Integer

Mode

Specify the type of micro-messages you want to display. Choices are:

User—micro-messages for logged-in user with search option

Colleagues—micro-messages for logged-in user and colleagues of a specified user with search option

TimeLine—micro-messages from all site users whose Private Profile setting is set to Public; includes search option

Message—a single message

See Also: Micro-messaging Display Modes

ActivityFeedType

ProfileParamName

The parameter name to pass in the QueryString to the TemplateUserProfile page, if you want it to be anything other than id.

For example, you may prefer messageid, because it is more descriptive.

String

SpamControlType

Assigns a spam filter to the micro-messages. The control supplies three predefined spam filters, and the ability to define your own.

Note: Spam control is turned off by default.

Filter choices are:

SameUserMessageDay—prevents a user from posting the same message to the board more than once per day

SameUserTimeDelay—prevents a user from posting another message for specified period of time. The amount of time is specified, in seconds, in the SpamTimeSpan property.

SameMessageTimeDelay—prevents a user from posting an identical message for a specified period of time. The amount of time is specified, in seconds, in the SpamTimeSpan property.

Custom—control uses custom spam filter code. See Creating a Custom Spam Filter.

See Also: Filtering Micro-message Spam

 

SpamTimeSpan

Sets the amount of time, in seconds, for which the SameUserTimeDelay or SameMessageTimeDelay spam filter delays a user from posting. These values can be selected in the SpamControlType property.

See Also: Filtering Micro-message Spam

Integer

Stylesheet

Specify the path to a style sheet for use with the Documents server control. The location can be relative or absolute. Leave blank to use the default style sheet.

String

SuppressWrapperTags

Suppresses the output of the span/div tags around the control. The default is False.

True—Suppress wrap tags.

False—Allow wrap tags.

Boolean

TemplateMessage

The URL path to a page that contains another Micro-messaging server control.

When this property contains such a path, and the destination page has a Micro-messaging control whose Mode property is set to Message, a user can click a micro-message’s time span on the first page to open a second page that contains just that message.

See Also: Making a Hyperlink to a Single Page Version of a Micro-message

String

TemplateUserProfile

The URL path to the page that contains the UserProfile server control. This path can be relative or absolute.

If you enter a path, a user can click any user’s name or avatar from the Micro-message server control and be forwarded to his profile page. See illustration below.

Note that user templates can be defined in the Ektron CMS400.NET Workarea > Settings > Community Management > Templates screen.

However, if you assign a template in this field, this setting takes precedence over the setting on the Workarea Template screen.

String

WrapTag

Allows a developer to specify a server control’s tag.

The default is Span.

Span—The <span> tag is used to designate an inline portion of an HTML document as a span element.

Div—The <div> tag is used when you want to apply attributes to a block of code.

Custom—Allows you to use a custom tag.

String


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.